package controllers

import (
	"git.oschina.net/tinkler/for_kmjxc/models/km"
)

//  Operation about payflow
type PayflowController struct {
	HelperController
}

// @Title 获取付款单列表
// @Description get the supcust list
// @Param supcustNo path string true "The supcust'no of payflow."
// @Success 200 {object} models.km.RpTRecpayRecordInfo
// @router /:supcustNo [get]
func (p *PayflowController) GetList() {
	supcustNo := p.GetString(":supcustNo")
	if km.IsValidSupcustNo(supcustNo) {
		p.Data[`json`] = km.GetRpTRecpayRecordInfoListBySupcustNo(supcustNo)
	}
	p.ServeAPI()
}

// @Title 查询付款单明细
// @Description 通过付款单编号获取付款单明细
// @Param sheetNo path string true "the sheet'no of payflow's detail."
// @Success 200 {object} models.km.RpTRecpayRecordInfo
// @router /detail/:sheetNo [get]
func (p *PayflowController) GetDetail() {
	sheetNo := p.GetString(":sheetNo")
	p.Data[`json`] = km.GetRpTRecpayRecordInfoBySheetNo(sheetNo)
	p.ServeAPI()
}
